#include<bits/stdc++.h>
using namespace std;
queue<int>mq , nq;
int main(){
	freopen("party.in" , "r" , stdin);
	freopen("party.out" , "w" , stdout);
	int m , n;
	int k;
	cin >> m >> n;
	cin >> k;
	for(int i = 1 ; i <= m ; i++) mq.push(i);
	for(int i = 1 ; i <= n ; i++) nq.push(i);
	while(k--){
		cout << mq.front() << " " << nq.front() << endl;
		mq.push(mq.front());
		mq.pop();
		nq.push(nq.front());
		nq.pop(); 
	}
	return 0;
}
